define('pc/js/mod/write/Copyright', ['pc/js/components/Select/Select'], function(Select){

function Copyright(id, descId) {
    this.copyrightDesc = {
        'id0': '他人将不得对内容进行复制和转载。',
        'id1': '他人可对专栏内容进行复制和转载，但转载时需注明文章作者、出处、来源。'
    };

    this.descWrapper = document.getElementById(descId);

    this.select = new Select().render(document.getElementById(id), [
        {text: '禁止转载', value: '0'},
        {text: '可以规范转载', value: '1'}
    ]);

    this.init();
}

Copyright.prototype = {
    constructor: Copyright,

    init: function() {
        var _self = this;

        this.select.onChange = function(v) {
            _self.descWrapper.innerHTML = _self.copyrightDesc['id' + v];
        };

        // defaultValue
        this.setValue('1');
    },

    getValue: function() {
        return this.select.value;
    },
    setValue: function(v) {
        this.select.setValue(v);
    }
};

return {
    init: function(copyId, descId) {
        return new Copyright(copyId, descId);
    }
};
});

